/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package padroes_3;

import java.util.ArrayList;

/**
 *
 * @author Delvoux
 */
public class FundoDeInvestimentoIterator implements Iterator{
    private ArrayList<FundoDeInvestimento> fundo;
    private int pos = 0;

    public FundoDeInvestimentoIterator(ArrayList<FundoDeInvestimento> fundo) {
        this.fundo = fundo;
    }

    public boolean hasNext() {
        return pos < fundo.size();
    }

    public Object next() {
        try {
            return fundo.get(this.pos++);
        } catch (Exception e) {
            System.err.println("Índice excedido.");
        }
        return null;
    }

}
